package com.jic.point.mapper;

import com.jic.point.model.entity.ConfActivityRule;
import com.jic.point.model.entity.ConfBd;
import com.jic.point.model.entity.ConfBdPlatfromRela;
import com.jic.point.model.entity.ConfPlatform;
import com.jic.point.model.vo.response.ConfFaultTreeResponse;
import com.jic.point.rest.request.SignData;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface ConfPlatformMapper {
	/**
	 * CONF_PLATFORM插入数据
	 * @param confPlatform 入参实体类
	 */
	int insert (ConfPlatform confPlatform);

	/**
	 * CONF_PLATFORM插入数据
	 * @param confPlatform 入参实体类
	 */
	int insertSelective (ConfPlatform confPlatform);

	/**
	 * CONF_PLATFORM根据表对象数据修改数据
	 * @param confPlatform 入参实体类
	 */
	int updateByPrimaryKey (ConfPlatform confPlatform);

    /**
     * CONF_PLATFORM根据表对象数据修改数据
     * @param confPlatform 入参实体类
     */
    int updateByPrimaryKeyApply (ConfPlatform confPlatform);
	/**
	 * CONF_PLATFORM根据表对象数据修改数据
	 * @param confPlatform 入参实体类
	 */
	int updateByPrimaryKeySelective (ConfPlatform confPlatform);

	/**
	 * CONF_PLATFORM根据id删除数据
	 * @param confPlatform 入参实体类
	 */
	int deleteByPrimaryKey (ConfPlatform confPlatform);

	/**
	 * CONF_PLATFORM根据主键查询数据
	 * @param confPlatform 入参实体类
	 */
	ConfPlatform selectByPrimaryKey (ConfPlatform confPlatform);


	/**
	 *
	 *
	 * @description: 根据code查询数据
	 * @return: 
	 * @author: fengrui
	 * @time: 2020/11/26 11:24
	 */  
	ConfPlatform getByPrimaryCode(ConfPlatform request);

	/**
	 * CONF_PLATFORM根据主键查询数据
	 * @param confPlatform 入参实体类
	 */
	List<ConfPlatform> listPageBySelective (ConfPlatform confPlatform);

	/**
	 * CONF_PLATFORM查询数据
	 * @param confPlatform 入参实体类
	 */
	List<ConfPlatform>  selectBySelective (ConfPlatform confPlatform);

    ConfPlatform getPlatformCode(@Param("PlatformCode") String platformCode);

	Long updatePoint(ConfPlatform confPlatform);

	List<ConfFaultTreeResponse> selectFaultTree();

	/**
	 * 查询全部的平台 用以下拉框
	 * @return
	 */
	List<ConfPlatform> getAlltPlatform();

	/**
	 *获取子平台的code
	 * */
	String getPlatformCodes(@Param("id") Long id);


	String queryPlatformCode(@Param("item") String item);

	Integer addPoint(@Param("code") String code,@Param("point") BigDecimal point);

	Integer updatePointCode(ConfPlatform confPlatform);


	List<ConfBdPlatfromRela> getPlatfromRela(ConfPlatform param);

	int activityRuleDeductionPoints(ConfActivityRule confActivityRule);

	int insertPlatFromLog(ConfActivityRule confActivityRule);

	//通过code查询 平台
	List<ConfPlatform> selectByPrimaryCode(SignData signData);

    BigDecimal queryAvailablePoint(@Param("code") String busiCode);

    List<ConfPlatform> selectByPrimaryBdCode(@Param("bdCode") String code);

    List<ConfBd> selectBdAvailable();

	List<ConfBd> selectBdTotal();

	List<ConfBd> sekectBdFrozen();

	List<ConfBd> selectBdRealLeft();

    List<ConfPlatform> listPagefreeze(List<Integer> sts);

    int platformPointAdd(ConfPlatform confPlatform);

    int platformPointDeduction(ConfPlatform confPlatform);
}
